package cn.bdqn.hospital.dao;

import cn.bdqn.hospital.entity.Drug;

import java.sql.SQLException;
import java.util.List;

public interface DrugDao {
    /**
     * 查询所有药品
     * @return
     * @throws SQLException
     */
    public List<Drug> getAll() throws SQLException;

    /**
     * 通过id查询
     * @param drugId
     * @return
     * @throws SQLException
     */
    public Drug getDrugBydrugId(Integer drugId) throws  SQLException;
    /**
     * 通过名称查询药品
     * @param drugName
     * @return
     * @throws SQLException
     */
    public Drug getDrugBydrugName(String drugName) throws SQLException;

    /**
     * 新增药品
     * @param drug
     * @return
     * @throws SQLException
     */
    public int add(Drug drug) throws SQLException;

    /**
     * 修改药品
     * @param drug
     * @return
     * @throws SQLException
     */
    public int update(Drug drug) throws  SQLException;

    /**
     * 删除药品
     * @param drugId
     * @return
     * @throws SQLException
     */
    public int delete(Integer drugId) throws  SQLException;
}
